fix bugs in addhms.
authortsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 13 Apr 2014 13:26:17 +0000 (13:26 +0000)
committertsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 13 Apr 2014 13:26:17 +0000 (13:26 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4808 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/csv_util.cc

index df44a5cc942f3f6ac04e182daa3a29dced855c58..c597efa1faa8b20863d7a5b4bf80826183189226 100644 (file)
@@ -868,13 +868,13 @@ addhms(const char* s, const char* format)
   int ac;
 
   ampm = (char*) xmalloc(strlen(s) + 1);
-  ac = sscanf(s, format, &hour, &min, &sec, &ampm);
+  ac = sscanf(s, format, &hour, &min, &sec, ampm);
   /* If no time format in arg string, assume AM */
   if (ac < 4) {
     ampm[0] = 0;
   }
   if (ac) {
-    tt = ((tolower(ampm[0])=='P')?43200:0)+3600*hour+60*min+sec;
+    tt = ((tolower(ampm[0])=='p')?43200:0)+3600*hour+60*min+sec;
   }
   xfree(ampm);